<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class PerformanceScore extends Model
{
	use SoftDeletes;
	protected $fillable = ['employee_id', 'performance_item_id', 'type', 'score'];

	const TYPE_SELF	=	'self';
	const TYPE_OTHER	=	'other';

	public static $typeMap	=	[
		self::TYPE_SELF	=>	'自评',
		self::TYPE_OTHER	=>	'他评',
	];

	public function employee() {
		return $this->belongsTo(Employee::class);
	}

	public function performanceItem() {
		return $this->belongsTo(PerformanceItem::class);
	}
}
